
vector<vector<int>> ret;
if (root == nullptr)
    return ret;

queue<Node *> q;
q.push(root);
while (q.size())
{
    int sz = q.size();
        vector<int> dp;

    while (sz--)
    {
        Node*tmp=q.front();
        q.pop();
        dp.push_back(tmp->val);
        for (auto child : tmp->children)
        {
            if(child!=nullptr)
            q.push(child);
        }
    }
        ret.push_back(dp);

}

return ret;